//
//  PayQueryController.m
//  PropertyMananger
//
//  Created by Mansion on 17/2/25.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "QueryResultController.h"
#import "PayQueryCell.h"
#import "PayQueryDetailController.h"
#import "QueryResultModel.h"

@interface QueryResultController ()

@end

@implementation QueryResultController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self initTitleViewName:@"物业缴费查询"];
    
    [self initTableViewWithView:self.view frame:CGRectMake(0, 0, BHscreenW, BHscreenH - 64) isGroup:NO];
    
    self.tableView.separatorStyle = NO;
    self.tableView.backgroundColor = BHGrayColor;
    
    DLog(@"选 === %ld",self.selectedType);
    
    
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{

    return self.propertyArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 1;

}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    PayQueryCell * cell = [PayQueryCell cellWithTableView:tableView indexPath:indexPath];
    
    QueryResultModel * model = self.propertyArray[indexPath.section];
    
     cell.selectedType = self.selectedType;
    cell.model = model;
   
    
    return cell;

}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    return 150;

}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{

    if (section == 0) {
        
        return 0.001f;
    }else{
     return 15;
    }

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

     PayQueryDetailController * queryDetVC = [[PayQueryDetailController alloc]init];
     QueryResultModel * model = self.propertyArray[indexPath.section];
     queryDetVC.model = model;
     [self.navigationController pushViewController:queryDetVC animated:YES];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    
}


@end
